From 505e1e605341aef86f1e747d9a4bbe992d2535e0 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 20 May 2005 14:20:31 +0000 Subject: [PATCH] bitkeeper revision 1.1485 (428df22fkTwCIupDtELAwUuLnujDkQ) Manual merge. --- linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c b/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c index f5ee589ee3..d60a0126b7 100644 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c @@ -78,7 +78,6 @@ void vbd_create(blkif_be_vbd_create_t *create) vbd->vdevice = vdevice; vbd->readonly = create->readonly; - vbd->type = VDISK_TYPE_DISK | VDISK_FLAG_VIRT; /* Mask to 16-bit for compatibility with old tools */ vbd->pdevice = create->pdevice & 0xffff; @@ -101,6 +100,9 @@ void vbd_create(blkif_be_vbd_create_t *create) bdev_put(vbd->bdev); return; } + + vbd->type = (vbd->bdev->bd_disk->flags & GENHD_FL_CD) ? + VDISK_TYPE_CDROM : VDISK_TYPE_DISK; #else if ( (blk_size[MAJOR(vbd->pdevice)] == NULL) || (vbd_sz(vbd) == 0) ) { @@ -108,6 +110,8 @@ void vbd_create(blkif_be_vbd_create_t *create) create->status = BLKIF_BE_STATUS_PHYSDEV_NOT_FOUND; return; } + + vbd->type = VDISK_TYPE_DISK; #endif spin_lock(&blkif->vbd_lock); -- 2.30.2